﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.Common.Data;
using Simple.Entity.Models;

namespace Simple.Service
{
    public class UserActivityService : ApplicationService
    {
        private readonly WorkEfRepository<Sys_ActivityLog> _activityLogRepository;

        public UserActivityService(WorkEfRepository<Sys_ActivityLog> activityLogRepository)
        {
            _activityLogRepository = activityLogRepository;
        }

        /// <summary>
        /// 记录用户行为
        /// </summary>
        /// <param name="LoginNo"></param>
        /// <param name="comment"></param>
        public void InsertActivityLog(string LoginNo, string comment)
        {
            Sys_ActivityLog sys_ActivityLog = new Sys_ActivityLog()
            {
                Comment = comment,
                LoginNo = LoginNo,
                CreateTime = DateTime.Now
            };
            _activityLogRepository.Add(sys_ActivityLog);
        }
    }
}
